package lee.vioson.ebook.ui

import android.os.Bundle
import androidx.activity.compose.setContent
import androidx.appcompat.app.AppCompatActivity
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Color
import androidx.core.view.WindowCompat
import com.google.accompanist.systemuicontroller.rememberSystemUiController
import lee.vioson.ebook.App
import lee.vioson.ebook.data.AppContainer

/**
 *Author:viosonlee
 *Date:2023/6/12
 *DESCRIPTION:
 */
abstract class BaseActivity : AppCompatActivity() {
    val appContainer: AppContainer by lazy { (application as App).appContainer }
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        WindowCompat.setDecorFitsSystemWindows(window, false)
        setContent {
            val systemUiController = rememberSystemUiController()
            systemUiController.setStatusBarColor(Color.Transparent, darkIcons = false)
            systemUiController.setNavigationBarColor(Color.Transparent, darkIcons = false)
            AppTheme { Content() }
        }
    }

    @Composable
    abstract fun Content()
}